import request from '@/utils/request'
import type {
  TrademarkListDataModel,
  TrademarkModel,
} from './model/trademarkModel'

enum Api {
  // 获取品牌列表api
  getTrademarkListApi = '/admin/product/baseTrademark',
  //新增品牌
  saveTrademarkApi = '/admin/product/baseTrademark/save',
  //修改品牌
  updateTrademarkApi = '/admin/product/baseTrademark/update',
  //删除品牌
  deleteTrademarkApi = "/admin/product/baseTrademark/remove"
}
export const reqGetTrademarkListData = (page: number, limit: number) => {
  return request.get<any, TrademarkListDataModel>(
    `${Api.getTrademarkListApi}/${page}/${limit}`
  )
}

//添加品牌的请求
export const reqSaveTrademarkInfo = (trademark: TrademarkModel) => {
  return request.post<any, null>(`${Api.saveTrademarkApi}`,trademark)
}

//修改品牌的请求
export const reqUpdateTrademarkInfo = (trademark: TrademarkModel) => {
  return request.put<any, null>(`${Api.updateTrademarkApi}`,trademark)
}

//删除品牌的请求
export const reqDeleteTrademarkInfo = (id:number) => {
  return request.delete<any, null>(`${Api.deleteTrademarkApi}/${id}`)
}
